package com.chinasofti.proxy;

interface ClothFactory{//服装厂接口
    void productCloth();//生产服装
}

//李宁服装厂
class LiNingClothFactory  implements ClothFactory {

    @Override
    public void productCloth() {
        System.out.println("李宁服装厂生产了一批衣服");
    }
}
//代理  --  销售商
class DaiLi implements ClothFactory {

  LiNingClothFactory ln;

    public DaiLi(LiNingClothFactory ln){
        this.ln = ln;
    }

    @Override
    public void productCloth() {
        System.out.println("代理人开始卖衣服了，衣服是谁家生产的");
        ln.productCloth();
    }
}

public class Proxy1 {
    public static void main(String[] args) {
      LiNingClothFactory ln = new LiNingClothFactory();
       DaiLi lilei = new DaiLi(ln);
        lilei.productCloth();

    }
}
